package com.bxw.forum.exception;

import com.bxw.forum.common.AppResult;

public class ApplicationException extends RuntimeException{


    //持有一个错误返回信息
    protected AppResult errorResult;

    /**
     * 自定义异常的构造方法
     * @param errorResult
     */
    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult = errorResult;

    }
    public ApplicationException(String message) {
        super(message);
    }
    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }

    public AppResult getErrorResult() {

        return this.errorResult;
    }

}
